package com.clive.service;

import com.clive.bean.DishesCategory;
import com.clive.dao.DishesCategoryDao;
import com.clive.dao.DishesCategoryDaoImpl;

import java.util.Date;
import java.util.List;

public class DishesCategoryServiceImpl implements DishesCategoryService {
    private DishesCategoryDao categoryDao = new DishesCategoryDaoImpl();
    @Override
    public boolean addDishesCategory(DishesCategory dishesCategory) {
        dishesCategory.setStatus(1);
        Date date = new Date();
        dishesCategory.setCreated(date);
        dishesCategory.setUpdated(date);
        int i = categoryDao.addDishesCategory(dishesCategory);
        if(i<=0){
            return false;
        }
        return true;
    }

    @Override
    public boolean deleteDishesCategory(Integer dishesCategoryId) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean updateDishesCategory(DishesCategory dishesCategory) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public List<DishesCategory> findDishesCategoryAll() {
        List<DishesCategory> list = categoryDao.findDishesCategoryAll();
        return list;
    }


}
